﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;

namespace XMM
{
    /// <summary>
    /// Interaktionslogik für About.xaml
    /// </summary>
    public partial class About : Window
    {
        public About()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Try load credits from README.txt...
            if (File.Exists(Tools.getInstallationPath() + "README.txt"))
            {
                string sREADME = File.ReadAllText(Tools.getInstallationPath() + "README.txt");

                txtCredits.Text = sREADME;
            }
            else
                txtCredits.Text = Properties.Resources.Credits;

            this.Title += System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            lblVersionNo.Content = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
    }
}
